#include "stdafx.h"
#include "DataTransModbusRTULogic.h"
#include <windows.h>
#include <commctrl.h>
#include <string>
using namespace std;

#define DataTransModbusRTU_API __declspec(dllexport)

#define DataTrans_LOGIC_NAME (L"ModbusRTU")


BOOL APIENTRY DllMain( HANDLE hModule, 
					  DWORD  ul_reason_for_call, 
					  LPVOID lpReserved
					  )
{
	return TRUE;
}


vector <DataTransModbusRTULogic*> pProList;

extern "C" DataTransModbusRTU_API DataTransModbusRTULogic* CreateProtocol()
{
	DataTransModbusRTULogic* pProtocol = new DataTransModbusRTULogic();

	if(pProtocol)
		pProList.push_back(pProtocol);

	return pProtocol;
}

extern "C" DataTransModbusRTU_API void Release()
{
	for(size_t ii=0;ii<pProList.size();ii++)
	{
		if(pProList[ii]) 
			delete pProList[ii];
	}
	pProList.clear();
}
